
import archinfo


def convert_arch(arch):
    """
    Convert an arch ID or an archinfo.Arch instance to an archinfo.Arch instance.
    """
    if isinstance(arch, str):
        the_arch = archinfo.arch_from_id(arch)
    else:
        the_arch = arch
    return the_arch
